---
import { generateMetaTags } from '../utils/seo';
import config from '@/config';

const { frontmatter } = Astro.props;

const metaTags = generateMetaTags({
  title: frontmatter.title,
  description: frontmatter.description,
  url: `${config.appURL}${frontmatter.url}`,
});
---

<head>
  <title>{frontmatter.title}</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, viewport-fit=cover">
  {metaTags.map(t => (
    <meta content={t.content} name={t.name} property={t.property} >
  ))}
  <script is:inline src="/loadTheme.js"></script>
  <script type="text/partytown" src="https://www.googletagmanager.com/gtag/js?id=G-4B3ZD2EWVX"></script>
  <script type="text/partytown">
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());

    gtag('config', 'G-4B3ZD2EWVX');
  </script>
</head>
